home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / bin / in-target < prev    next >
Text File  |  2009-07-03  |  498b  |  32 lines

  1. #!/bin/sh
  2. set -e
  3. . /lib/chroot-setup.sh
  4.  
  5. STDOUT=
  6. if [ "$1" = "--pass-stdout" ]; then
  7.     STDOUT=$1
  8.     shift
  9. fi
  10.  
  11. if ! chroot_setup; then
  12.     logger -t in-target -- "Unexpected error; command not executed: '$@'"
  13.     exit 1
  14. fi
  15.  
  16. DEBCONF_READFD=0
  17. export DEBCONF_READFD
  18. DEBCONF_WRITEFD=3
  19. export DEBCONF_WRITEFD
  20. DEBIAN_FRONTEND=passthrough
  21. export DEBIAN_FRONTEND
  22. ERRCODE=0
  23. log-output -t in-target $STDOUT chroot /target "$@" || ERRCODE=$?
  24.  
  25. chroot_cleanup
  26.  
  27. if [ "$ERRCODE" != 0 ]; then
  28.     exit $ERRCODE
  29. else
  30.     exit 0
  31. fi
  32.